<!DOCTYPE html>
<html>
  <head>
    <title><%= title %></title>
    <link rel='stylesheet' href='/stylesheets/style.css' />
    <link rel="stylesheet" href="/css/main.css">
    <link href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/3.4.1/css/bootstrap.min.css" rel="stylesheet">
  </head>
  <body>
    <h3>选择城市</h3>
    <select name="北京市" id="province">
      <option value="-1" selected>请选择省份</option>
    </select>
    <select name="北京市" id="city">
      <option value="-1" selected>请选择城市</option>
    </select>
    <h1>北京市未来七日天气预报</h1>
    <div>

      <table class="table table-bordered table-striped table-hover">
          <thead>
              <tr>
                  <td>时间</td>
                  <td>温度</td>
                  <td>天气</td>
                  <td>风向</td>
                  <td>风力</td>
              </tr>
          </thead>
          <tbody>
              <tr>
                  <td></td>
              </tr>
          </tbody>
          
      </table>
  </div>
  
  <!-- <script src="/js/jsonp.js"></script> -->
  <script>

    //   jsonp({
    //       url: "https://wis.qq.com/weather/common",
    //       data: {
    //           source: "pc",
    //           weather_type: "forecast_24h",
    //           province: "province",
    //           city: "city"
    //       },
    //       success: function(data){
    //           // console.log(data);
    //           var {data: {forecast_24h: fdata}} = data;
    //           // console.log(fdata);


    //           var tbody = document.querySelector("tbody");


    //           tbody.innerHTML = "";
             
    //           Object.values(fdata).forEach(item => {
    //               var tr = `<tr><td>${item.time}</td>
    //                         <td>${item.max_degree}</td>
    //                         <td>${item.day_weather}</td>
    //                         <td>${item.day_wind_power}</td>
    //                         <td>${item.day_wind_direction}</td><tr>`;


     
    //               tbody.insertAdjacentHTML("beforeend",tr);
                  
    //           });
    //       }

    //   })


//   </script>
  <script src="/js/ajax.js"></script>
  <script src="/js/main.js"></script>

  </body>
</html>
